from flask import Blueprint, url_for

admin_bp = Blueprint('admin', __name__,
                     # url_prefix='/admin',
                     template_folder='templates',
                     static_folder='static')

@admin_bp.route('/', defaults={'name': 'index'})
@admin_bp.route('/<name>')
def index(name):
    return 'Hello %s' % name

@admin_bp.route('/info')
def info():
    with admin_bp.open_resource('files/info.txt') as f:
        code = f.read()
    return code

@admin_bp.route('/root')
def root():
    return admin_bp.root_path

@admin_bp.route('/file')
def file():
    print(url_for('admin.root'))
    return url_for('.static', filename='style.css')
    # return url_for('admin.static', filename='style.css')